#pragma once
#include "../variant.h"
#include "system.h"
#include <armadillo>

#ifdef GRAPHENETOOLS_EXPORTS
#ifndef GRAPHENETOOLS_DLL_API
#define GRAPHENETOOLS_DLL_API __declspec(dllexport)
#endif
#else
#ifndef GRAPHENETOOLS_DLL_API
#define GRAPHENETOOLS_DLL_API __declspec(dllimport)
#endif
#endif

class GRAPHENETOOLS_DLL_API UnitFunctor
{
	System* sys;
	bool cartisian;
	enum atomtypes {
		index,
		allatoms
	} atomtype;
	size_t atomindex;
	enum bondtypes {
		inplane,
		outofplane,
		allbonds
	} bonds;
	bool uniquebonds;
	
	static const string cartisiansymbol;
	static const string atomsymbol;
	static const string bondtypessymbol;
	static const string uniquebondssymbol;

	static const string inplanesymbol;
	static const string outofplanesymbol;

public:
	UnitFunctor(System* s, const rule::list& opts = rule::list());
	
	bool exists(int id) const;
	size_t getAtomCount(int id) const;
	bool initialized(int id) const;
	bool initialize(int id) const;
	variant getAtoms(int id) const;
	variant getBonds(int id) const;
	variant getPeriodicity(int id) const;
	mat getReciprocity(int id) const;
	mat getBrillouin(int id) const;
	void setPeriodicity(int id, const imat& per) const;
};

